home *** CD-ROM | disk | FTP | other *** search
-
- ;DIRSIZE
- ;This file traverses the directory tree and computes the total
- ;size of all files on the drive.
- ;
- DirChange("C:\")
- BoxOpen("File Size Inspector","Reading Initial Directories")
- tot = FileSize(FileItemize("*.*"))
- sub1 = DirItemize("*.*")
- totdir=0
- level=1
- dir1=DirGet()
- numdir1 = ItemCount(sub1, " ")
- index1 = 0
-
- :dsloop
- If index%level% == numdir%level% Then Goto upalevel
- index%level% = index%level% + 1
- DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
- BoxText(strcat("Level=",level,@crlf,"Total=",tot,@crlf,dir%level%))
- totdir=totdir+1
- tot = tot + FileSize(FileItemize("*.*"))
- level = level + 1
- dir%level% = DirGet()
- sub%level% = DirItemize("*.*")
- numdir%level% = ItemCount(sub%level%, " ")
- index%level% = 0
- goto dsloop
-
- :upalevel
- drop(dir%level%,sub%level%,index%level%,numdir%level%)
- level=level-1
- if level!=0 then goto dsloop
-
- ; -----------
- ; Termination
- ; -----------
- BoxShut()
- If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
- tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
- tot = StrTrim(tot)
- If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
- tot = StrTrim(tot)
- If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
- tot = StrTrim(tot)
- Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
- Exit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-